FROM centos:7

MAINTAINER Yang <yangyufans@qq.com>

RUN yum install wget git-core -y

ENV NODE_VERSION v10.7.0

ENV NVM_VERSION v0.33.11

ENV BASH_PATH /root

RUN cd $BASH_PATH && \
    git clone https://github.com/creationix/nvm.git .nvm && \
    cd $BASH_PATH/.nvm && \
    git checkout $NVM_VERSION && \
    source $BASH_PATH/.nvm/nvm.sh && \
    nvm install $NODE_VERSION && \
    npm install -g hexo-cli

RUN mkdir /logs

ENV NODE_HOME "$BASH_PATH/.nvm/versions/node/$NODE_VERSION"
ENV PATH "$PATH:$NODE_HOME/bin"

EXPOSE 80

COPY start.sh /

RUN chmod 777 /start.sh

ENTRYPOINT ["/start.sh"]